Option Explicit

Private pbar As ProgressBar
Private hasInit As Boolean
Public Sub Init()
    Set pbar = New ProgressBar
    hasInit = True
End Sub

Public Sub setHighWaterMark(ByRef val As Integer, ByRef title As String)
    If Not hasInit Then
        Exit Sub
    End If

    pbar.setHighWaterMark val, title
End Sub

Public Sub splitPart(ByRef val As Integer)
    If Not hasInit Then
        Exit Sub
    End If

    pbar.splitPart val
End Sub

Public Sub setPartTitle(ByRef title As String)
    If Not hasInit Then
        Exit Sub
    End If
    pbar.setPartTitle title
End Sub

Public Sub nextPart()
    If Not hasInit Then
        Exit Sub
    End If

    pbar.nextPart
End Sub

Public Sub refreshPercent(ByRef v As Double)
    If Not hasInit Then
        Exit Sub
    End If

    pbar.refreshPercent v
End Sub

Public Sub refreshEnd()
    If Not hasInit Then
        Exit Sub
    End If

    pbar.refreshEnd
End Sub

Public Sub refreshMsg(ByRef msg As String)
    If Not hasInit Then
        Exit Sub
    End If

    pbar.refreshMsg msg
End Sub

Public Sub refresh(ByRef v As Double, ByRef msg As String)
    If Not hasInit Then
        Exit Sub
    End If

    pbar.refresh v, msg
End Sub

Public Sub Destroy()
    hasInit = False
    Set pbar = Nothing
End Sub